// throttle.ts
export function throttle<T extends (...args: any[]) => void>(fn: T, delay = 300): T {
  let last = 0
  return function(this: any, ...args: any[]) {
    const now = Date.now()
    if (now - last > delay) {
      last = now
      fn.apply(this, args)
    }
  } as T
} 